package org.example;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import javax.validation.constraints.*;

@Data
public class UserData {

    @ExcelIgnore
    private Integer rowIndex;

    @ExcelProperty("编号")
    @NotNull(message = "编号不能为空")
    private String code;

    @ExcelProperty("用户名")
    @NotEmpty(message = "用户名不能为空")
    @Size(min = 2, max = 30, message = "用户名长度必须在2~30个字符之间")
    private String username;

    @ExcelProperty("电子邮件")
    @Email(message = "邮箱格式不正确")
    @NotEmpty(message = "邮箱不能为空")
    private String email;


    @ExcelProperty("年龄")
    @Min(value = 1, message = "年龄必须为正整数")
    @NotNull(message = "年龄不能为空")
    private Integer age;
}